﻿package com.firewolf.reflect;

import java.lang.reflect.Field;

public class MainTestDriver {
	public static void main(String[] args) {
		EventTypeConstant eventType = new EventTypeConstant();
		try {
			Class<?> clzz = Class.forName(eventType.getClass().getName());
			Field[] declaredFields = clzz.getDeclaredFields();
			for (int i = 0; i < declaredFields.length; i++) {
				Field field = declaredFields[i];
				field.setAccessible(true);
				String fieldName = field.getName();
				String eventTypeCode = (String) field.get(eventType);
				FieldMeta meta = field.getAnnotation(FieldMeta.class);
				String eventTypeName = meta.name();
				
				System.out.println("fieldName = "+fieldName+"  fieldValue="+eventTypeCode+"  fieldAnnotion="+eventTypeName);
				
			}
		} catch (Exception e) {
			// TODO: handle exception
		}
	}
}
